<!-- eslint-disable vue/valid-v-slot -->
<template>
  <div class="main-container">
    <TableBody>
      <template #header>
        <TableHeader ref="tableHeaderRef" :show-filter="false">
          <template #search-content>
            <a-form ref="seachForm" :model="form" :style="{ width: '100%' }">
              <a-row :gutter="24">
                <a-col :span="4">
                  <a-form-item field="title" hide-label>
                    <a-input v-model="form.title" placeholder="请输入公告标题" allow-clear />
                  </a-form-item>
                </a-col>
                <a-col :span="4">
                  <a-form-item field="type" hide-label>
                    <a-select v-model="form.type" allow-clear placeholder="请选择公告类型">
                      <a-option :value="0">普通公告 </a-option>
                      <a-option :value="1">重要公告 </a-option>
                    </a-select>
                  </a-form-item>
                </a-col>
                <a-col :span="4">
                  <a-form-item field="type" hide-label>
                    <a-select v-model="form.topping" allow-clear placeholder="请选择公告置顶">
                      <a-option :value="1">开启 </a-option>
                      <a-option :value="0">关闭 </a-option>
                    </a-select>
                  </a-form-item>
                </a-col>
                <a-col :span="4">
                  <a-form-item field="type" hide-label>
                    <a-select v-model="form.forceOpen" allow-clear placeholder="请选择强制弹出">
                      <a-option :value="1">开启 </a-option>
                      <a-option :value="0">关闭 </a-option>
                    </a-select>
                  </a-form-item>
                </a-col>
                <a-col :span="4">
                  <a-form-item field="state" hide-label>
                    <a-select v-model="form.state" allow-clear placeholder="请选择公告状态">
                      <a-option :value="1">开启</a-option>
                      <a-option :value="0">关闭</a-option>
                    </a-select>
                  </a-form-item>
                </a-col>
                <a-col :span="4">
                  <a-form-item field="addTime" hide-label>
                    <a-date-picker
                      style="width: 100%"
                      v-model="form.addTime"
                      show-time
                      placeholder="请选择开始创建时间"
                      :time-picker-props="{ defaultValue: '12:00:00' }"
                      format="YYYY-MM-DD HH:mm:ss"
                      allow-clear
                      :shortcuts="[
                        {
                          label: '今日',
                          value: () => (
                            (form.addTime = $dayjs('00:00:00', 'HH:mm:ss').format(
                              'YYYY-MM-DD HH:mm:ss'
                            )),
                            (form.endTime = $dayjs('23:59:59', 'HH:mm:ss').format(
                              'YYYY-MM-DD HH:mm:ss'
                            ))
                          ),
                        },
                        {
                          label: '昨日',
                          value: () => (
                            (form.addTime = $dayjs('00:00:00', 'HH:mm:ss')
                              .subtract(1, 'day')
                              .format('YYYY-MM-DD HH:mm:ss')),
                            (form.endTime = $dayjs('23:59:59', 'HH:mm:ss')
                              .subtract(1, 'day')
                              .format('YYYY-MM-DD HH:mm:ss'))
                          ),
                        },
                        {
                          label: '七日',
                          value: () => (
                            (form.addTime = $dayjs('00:00:00', 'HH:mm:ss')
                              .subtract(6, 'day')
                              .format('YYYY-MM-DD HH:mm:ss')),
                            (form.endTime = $dayjs().format('YYYY-MM-DD HH:mm:ss'))
                          ),
                        },
                        {
                          label: '本月',
                          value: () => (
                            (form.addTime = $dayjs('01 00:00:00', 'DD HH:mm:ss').format(
                              'YYYY-MM-DD HH:mm:ss'
                            )),
                            (form.endTime = $dayjs().format('YYYY-MM-DD HH:mm:ss'))
                          ),
                        },
                        {
                          label: '上月',
                          value: () => (
                            (form.addTime = $dayjs(`01 00:00:00`, 'DD HH:mm:ss')
                              .subtract(1, 'month')
                              .format('YYYY-MM-DD HH:mm:ss')),
                            (form.endTime = $dayjs()
                              .subtract(1, 'month')
                              .endOf('month')
                              .format('YYYY-MM-DD HH:mm:ss'))
                          ),
                        },
                      ]"
                    />
                  </a-form-item>
                </a-col>
                <a-col :span="4">
                  <a-form-item field="endTime" hide-label>
                    <a-date-picker
                      style="width: 100%"
                      v-model="form.endTime"
                      show-time
                      placeholder="请选择结束创建时间"
                      :time-picker-props="{ defaultValue: '12:00:00' }"
                      format="YYYY-MM-DD HH:mm:ss"
                      allow-clear
                      :shortcuts="[
                        {
                          label: '今日',
                          value: () => (
                            (form.addTime = $dayjs('00:00:00', 'HH:mm:ss').format(
                              'YYYY-MM-DD HH:mm:ss'
                            )),
                            (form.endTime = $dayjs('23:59:59', 'HH:mm:ss').format(
                              'YYYY-MM-DD HH:mm:ss'
                            ))
                          ),
                        },
                        {
                          label: '昨日',
                          value: () => (
                            (form.addTime = $dayjs('00:00:00', 'HH:mm:ss')
                              .subtract(1, 'day')
                              .format('YYYY-MM-DD HH:mm:ss')),
                            (form.endTime = $dayjs('23:59:59', 'HH:mm:ss')
                              .subtract(1, 'day')
                              .format('YYYY-MM-DD HH:mm:ss'))
                          ),
                        },
                        {
                          label: '七日',
                          value: () => (
                            (form.addTime = $dayjs('00:00:00', 'HH:mm:ss')
                              .subtract(6, 'day')
                              .format('YYYY-MM-DD HH:mm:ss')),
                            (form.endTime = $dayjs().format('YYYY-MM-DD HH:mm:ss'))
                          ),
                        },
                        {
                          label: '本月',
                          value: () => (
                            (form.addTime = $dayjs('01 00:00:00', 'DD HH:mm:ss').format(
                              'YYYY-MM-DD HH:mm:ss'
                            )),
                            (form.endTime = $dayjs().format('YYYY-MM-DD HH:mm:ss'))
                          ),
                        },
                        {
                          label: '上月',
                          value: () => (
                            (form.addTime = $dayjs(`01 00:00:00`, 'DD HH:mm:ss')
                              .subtract(1, 'month')
                              .format('YYYY-MM-DD HH:mm:ss')),
                            (form.endTime = $dayjs()
                              .subtract(1, 'month')
                              .endOf('month')
                              .format('YYYY-MM-DD HH:mm:ss'))
                          ),
                        },
                      ]"
                    />
                  </a-form-item>
                </a-col>
                <!-- <a-col :span="4">
                  <a-form-item field="addReadNumber" hide-label>
                    <a-input-group>
                      <a-input
                        v-model="form.addReadNumber"
                        placeholder="开始查看人数"
                        allow-clear
                      />
                      <a-input
                        v-model="form.endReadNumber"
                        placeholder="结束查看人数"
                        allow-clear
                      />
                    </a-input-group>
                  </a-form-item>
                </a-col> -->
                <a-col :span="4">
                  <a-form-item field="btns" hide-label>
                    <a-space :size="15">
                      <a-button
                        type="primary"
                        v-permission="systemnotice"
                        html-type="submit"
                        @click="doRefresh(1)"
                        ><template #icon>
                          <icon-search />
                        </template>
                        <!-- Use the default slot to avoid extra spaces -->
                        <template #default>搜索</template></a-button
                      >
                      <a-button v-permission="systemnotice" @click="reset"
                        ><template #icon>
                          <icon-sync theme="outline" size="14" />
                        </template>
                        <!-- Use the default slot to avoid extra spaces -->
                        <template #default>重置</template></a-button
                      >
                    </a-space>
                  </a-form-item>
                </a-col>
              </a-row>
            </a-form>
          </template>
        </TableHeader>
      </template>
      <template #table-config>
        <a-space :size="15">
          <a-button type="primary" v-permission="systemnoticeadd" @click="visibles = true">
            <!-- Use the default slot to avoid extra spaces -->
            <template #default>新建</template>
          </a-button>
        </a-space>
        <a-space :size="15">
          <TableConfig
            @update-border="onUpdateBorder"
            @update-striped="onUpdateStriped"
            @refresh="doRefresh"
          />
        </a-space>
      </template>
      <template #default>
        <a-table
          :loading="tableLoading"
          :bordered="{ wrapper: tables.bordered, cell: tables.bordered }"
          :stripe="(tables.striped as boolean)"
          :data="table.dataList"
          :pagination="false"
          :row-key="rowKey"
          :row-class-name="rowClassNameFun"
        >
          <template #columns>
            <a-table-column
              v-for="item of tableColumns.list"
              :key="item.key"
              align="left"
              :title="(item.title as string)"
              :width="item.width"
              :data-index="(item.key as string)"
              :fixed="item.fixed"
              :ellipsis="true"
              :tooltip="true"
            >
              <template v-if="item.key === 'systemNoticeReadList'" #cell="{ record }">
                <span style="cursor: pointer" @click="seriesList(record.systemNoticeReadList)">{{
                  record.systemNoticeReadList.length
                }}</span>
              </template>
              <template v-if="item.key === 'forceOpen'" #cell="{ record }">
                <a-tag v-if="record.forceOpen == 0" color="red">关闭</a-tag>
                <a-tag v-else-if="record.forceOpen == 1" color="arcoblue">开启</a-tag>
              </template>
              <template v-if="item.key === 'title'" #cell="{ record }">
                <a-tag v-if="record.topping == 1" color="arcoblue" style="margin-right: 3px"
                  >置顶
                </a-tag>
                {{ record.title }}
              </template>
              <template v-if="item.key === 'type'" #cell="{ record }">
                <a-tag v-if="record.type == 1" color="red">重要</a-tag>
                <a-tag v-else-if="record.type == 0" color="arcoblue">普通</a-tag>
              </template>
              <template v-else-if="item.key === 'state'" #cell="{ record }">
                <a-tag v-if="record.state == 0" color="red">关闭</a-tag>
                <a-tag v-else-if="record.state == 1" color="arcoblue">正常</a-tag>
              </template>

              <template v-else-if="item.key === 'actions'" #cell="{ record }">
                <a-space :size="2">
                  <a-button
                    v-permission="systemnoticeupdate"
                    @click="detailFns(record)"
                    style="padding: 0px 4px"
                    type="text"
                    size="small"
                    >编辑</a-button
                  >
                  <a-button
                    v-permission="systemnoticedelete"
                    @click="onDeleteItem(record)"
                    style="padding: 0px 4px"
                    type="text"
                    size="small"
                    >删除</a-button
                  >
                </a-space>
              </template>
            </a-table-column>
          </template>
        </a-table>
      </template>
      <template #footer>
        <TableFooter :pagination="pagination" />
      </template>
    </TableBody>
    <!-- 查看公告 -->
    <a-drawer
      v-model:visible="visibles"
      :mask-closable="false"
      width="1020px"
      :title="title"
      @ok="handleSubmits"
      @cancel="beforeClose"
      @before-close="beforeClose"
    >
      <Scrollbar class="wrapper">
        <a-form ref="detailRef" :auto-label-width="true" :model="detail">
          <a-collapse class="top" v-model:active-key="list2" expand-icon-position="right">
            <a-collapse-item key="1">
              <template #header>
                <div class="box">
                  <div class="line"></div>
                  <div class="text">公告信息</div>
                </div>
              </template>
              <template #extra>
                <div>{{ list2.length == 1 ? '收起' : '展开' }}</div>
              </template>
              <div style="display: flex; flex-wrap: wrap; width: 1000px; margin-top: 12px">
                <a-form-item
                  class="input516"
                  :rules="[{ required: true, message: '请输入公告标题' }]"
                  asterisk-position="end"
                  field="title"
                  label="公告标题"
                >
                  <a-input placeholder="请输入公告标题" v-model.trim="detail.title" />
                </a-form-item>
                <a-form-item class="input516" field="type" label="公告类型">
                  <a-radio-group class="radio-bcg" v-model="detail.type">
                    <a-radio :value="0">
                      <template #radio="{ checked }">
                        <div
                          style="display: flex"
                          :class="{ 'custom-radio-card-checked': checked }"
                        >
                          <div className="custom-radio-card-mask">
                            <div className="custom-radio-card-mask-dot"></div>
                          </div>
                          <div className="custom-radio-card-title">普通公告</div>
                        </div>
                      </template>
                    </a-radio>
                    <a-radio :value="1">
                      <template #radio="{ checked }">
                        <div
                          style="display: flex"
                          :class="{ 'custom-radio-card-checked': checked }"
                        >
                          <div className="custom-radio-card-mask">
                            <div className="custom-radio-card-mask-dot"></div>
                          </div>
                          <div className="custom-radio-card-title">重要公告</div>
                        </div>
                      </template>
                    </a-radio>
                  </a-radio-group>
                </a-form-item>
                <a-form-item field="topping" class="input516" label="公告置顶">
                  <a-radio-group class="radio-bcg" v-model="detail.topping">
                    <a-radio :value="1">
                      <template #radio="{ checked }">
                        <div
                          style="display: flex"
                          :class="{ 'custom-radio-card-checked': checked }"
                        >
                          <div className="custom-radio-card-mask">
                            <div className="custom-radio-card-mask-dot"></div>
                          </div>
                          <div className="custom-radio-card-title">开启</div>
                        </div>
                      </template>
                    </a-radio>
                    <a-radio :value="0">
                      <template #radio="{ checked }">
                        <div
                          style="display: flex"
                          :class="{ 'custom-radio-card-checked': checked }"
                        >
                          <div className="custom-radio-card-mask">
                            <div className="custom-radio-card-mask-dot"></div>
                          </div>
                          <div className="custom-radio-card-title">关闭</div>
                        </div>
                      </template>
                    </a-radio>
                  </a-radio-group>
                </a-form-item>
                <a-form-item field="forceOpen" class="input516" label="强制弹出">
                  <a-radio-group class="radio-bcg" v-model="detail.forceOpen">
                    <a-radio :value="1">
                      <template #radio="{ checked }">
                        <div
                          style="display: flex"
                          :class="{ 'custom-radio-card-checked': checked }"
                        >
                          <div className="custom-radio-card-mask">
                            <div className="custom-radio-card-mask-dot"></div>
                          </div>
                          <div className="custom-radio-card-title">开启</div>
                        </div>
                      </template>
                    </a-radio>
                    <a-radio :value="0">
                      <template #radio="{ checked }">
                        <div
                          style="display: flex"
                          :class="{ 'custom-radio-card-checked': checked }"
                        >
                          <div className="custom-radio-card-mask">
                            <div className="custom-radio-card-mask-dot"></div>
                          </div>
                          <div className="custom-radio-card-title">关闭</div>
                        </div>
                      </template>
                    </a-radio>
                  </a-radio-group>
                </a-form-item>
                <a-form-item class="input516" field="wechat" label="发送通知">
                  <div class="radio-bcg">
                    <!-- <a-checkbox v-model="detail.wechat" :value="true">微信通知</a-checkbox> -->
                    <a-checkbox v-model="detail.sms" :value="true">短信通知</a-checkbox>
                    <a-checkbox v-model="detail.email" :value="true">邮箱通知</a-checkbox>
                  </div>
                </a-form-item>
                <a-form-item class="input516" field="noticeUser" label="通知用户">
                  <a-radio-group class="radio-bcg" v-model="detail.noticeUser" @change="changes">
                    <a-radio :value="0">
                      <template #radio="{ checked }">
                        <div
                          style="display: flex"
                          :class="{ 'custom-radio-card-checked': checked }"
                        >
                          <div className="custom-radio-card-mask">
                            <div className="custom-radio-card-mask-dot"></div>
                          </div>
                          <div className="custom-radio-card-title">所有</div>
                        </div>
                      </template>
                    </a-radio>
                    <a-radio :value="1">
                      <template #radio="{ checked }">
                        <div
                          style="display: flex"
                          :class="{ 'custom-radio-card-checked': checked }"
                        >
                          <div className="custom-radio-card-mask">
                            <div className="custom-radio-card-mask-dot"></div>
                          </div>
                          <div className="custom-radio-card-title">一级</div>
                        </div>
                      </template>
                    </a-radio>
                    <a-radio :value="2">
                      <template #radio="{ checked }">
                        <div
                          style="display: flex"
                          :class="{ 'custom-radio-card-checked': checked }"
                        >
                          <div className="custom-radio-card-mask">
                            <div className="custom-radio-card-mask-dot"></div>
                          </div>
                          <div className="custom-radio-card-title">二级</div>
                        </div>
                      </template>
                    </a-radio>
                    <a-radio :value="3">
                      <template #radio="{ checked }">
                        <div
                          style="display: flex"
                          :class="{ 'custom-radio-card-checked': checked }"
                        >
                          <div className="custom-radio-card-mask">
                            <div className="custom-radio-card-mask-dot"></div>
                          </div>
                          <div className="custom-radio-card-title">三级</div>
                        </div>
                      </template>
                    </a-radio>
                    <a-radio :value="4">
                      <template #radio="{ checked }">
                        <div
                          style="display: flex"
                          :class="{ 'custom-radio-card-checked': checked }"
                        >
                          <div className="custom-radio-card-mask">
                            <div className="custom-radio-card-mask-dot"></div>
                          </div>
                          <div className="custom-radio-card-title">自定义</div>
                        </div>
                      </template>
                    </a-radio>
                  </a-radio-group>
                </a-form-item>
                <a-form-item
                  class="input516"
                  field="userIdList"
                  v-if="detail.noticeUser == 4"
                  label="通知用户"
                >
                  <a-select
                    class="width100"
                    v-model="detail.userIdList"
                    placeholder="请选择客户"
                    multiple
                    :max-tag-count="1"
                    allow-clear
                    :options="userList"
                    :virtual-list-props="{ height: 200 }"
                  />
                </a-form-item>
              </div>
            </a-collapse-item>
          </a-collapse>
          <a-collapse class="top" v-model:active-key="list4" expand-icon-position="right">
            <a-collapse-item key="1">
              <template #header>
                <div class="box">
                  <div class="line"></div>
                  <div class="text">公告内容</div>
                </div>
              </template>
              <template #extra>
                <div>{{ list4.length == 1 ? '收起' : '展开' }}</div>
              </template>
              <div style="display: flex; flex-wrap: wrap; width: 1000px; margin-top: 12px">
                <a-form-item class="input516" field="content" label="通知内容">
                  <a-card :body-style="{ padding: '0px' }">
                    <RichTextEditor
                      v-if="visibles"
                      v-model="detail.content"
                      ref="richTextEditors"
                    />
                  </a-card>
                </a-form-item>
              </div>
            </a-collapse-item>
          </a-collapse>
        </a-form>
      </Scrollbar>
      <template #footer>
        <a-space>
          <a-button @click="beforeClose">取消</a-button>
          <a-button type="primary" @click="handleSubmits">确定</a-button>
        </a-space>
      </template>
    </a-drawer>
    <a-modal
      v-model:visible="addtagvisibles"
      title="查看人数"
      width="450px"
      :mask-closable="false"
      title-align="start"
    >
      <a-table :data="series" :row-key="rowKey" :pagination="{ pageSize: 10 }">
        <template #columns>
          <a-table-column
            v-for="item of tableColumns1.list"
            :key="item.key"
            align="left"
            :width="180"
            :title="(item.title as string)"
            :data-index="(item.key as string)"
            :ellipsis="true"
            :tooltip="true"
          />
        </template>
      </a-table>
      <template #footer>
        <a-space />
      </template>
    </a-modal>
  </div>
</template>

<script setup lang="ts">
  import { systemnotice, systemnoticeadd, systemnoticeupdate, systemnoticedelete } from '@/api/url'
  import { get, post } from '@/api/http'
  import useCommonStore from '@/store/modules/common'
  import { usePagination, useRowKey, useTable } from '@/hooks/table'
  import { onMounted, reactive, ref } from 'vue'
  import { Message, Modal } from '@arco-design/web-vue'
  const pagination = usePagination(doRefresh)
  const rowKey = useRowKey('id')
  const useCommon = useCommonStore()
  const table = useTable()
  const visibles = ref(false)
  const seachForm = ref()
  const details = ref()
  const addtagvisibles = ref(false)
  const series = ref([])
  const list4 = ref(['1'])
  const list2 = ref(['1'])
  const tableColumns1: any = reactive({
    list: [
      {
        title: '客户账号',
        key: 'userName',
        dataIndex: 'userName',
      },
      {
        title: '查看时间',
        key: 'addTime',
        dataIndex: 'addTime',
      },
    ],
  })
  const richTextEditors = ref()
  const detail: any = ref({
    title: '',
    type: 0,
    topping: 0,
    forceOpen: 0,
    wechat: false,
    sms: false,
    email: false,
    noticeUser: 0,
    state: 1,
    content: '',
    userIdList: [],
  })
  const userList: any = ref([])
  const detailRef = ref()
  const title = ref('添加公告')
  const form = reactive({
    title: '',
    type: '',
    topping: '',
    forceOpen: '',
    state: '',
    addTime: '',
    endTime: '',
    addReadNumber: '', // 开始已读人数
    endReadNumber: '', // 结束已读人数
  })
  const tableLoading = ref(false)
  const tables = reactive({
    tableLoading: false,
    bordered: false,
    striped: false,
    expand: [1],
    isExpand: false,
  })
  const tableColumns: any = reactive({
    list: [
      {
        title: '公告标题',
        key: 'title',
        dataIndex: 'title',
        checked: true,
      },
      {
        title: '公告类型',
        key: 'type',
        dataIndex: 'type',
        checked: true,
      },
      {
        title: '查看人数',
        key: 'systemNoticeReadList',
        dataIndex: 'systemNoticeReadList',
        checked: true,
      },
      {
        title: '强制弹出',
        key: 'forceOpen',
        dataIndex: 'forceOpen',
        checked: true,
      },
      {
        title: '公告状态',
        key: 'state',
        dataIndex: 'state',
        checked: true,
      },
      {
        title: '创建时间',
        key: 'addTime',
        dataIndex: 'addTime',
        checked: true,
        width: 190,
      },
      {
        title: '操作',
        key: 'actions',
        fixed: 'right',
        dataIndex: 'actions',
        width: 120,
        align: 'center',
        checked: true,
      },
    ],
  })

  const onDeleteItem = (item: any) => {
    Modal.warning({
      title: '操作确认',
      content: '确定要删除此公告吗？',
      cancelText: '取消',
      titleAlign: 'start',
      hideCancel: false,
      okText: '确定',
      onOk() {
        get({
          url: systemnoticedelete,
          data: {
            id: item.id,
          },
        }).then((res) => {
          if (res.code == 0) {
            Message.success(res.msg)
            beforeClose()
            doRefresh()
          }
        })
      },
    })
  }

  function seriesList(val: any) {
    series.value = val
    addtagvisibles.value = true
  }

  function changes() {
    detail.value.userIdList = []
    console.log(detail.value.userIdList)
  }

  const reset = () => {
    seachForm.value.resetFields()
    form.addReadNumber = '' // 开始已读人数
    form.endReadNumber = '' // 结束已读人数
    doRefresh(1)
  }

  const handleSubmits = () => {
    // console.log(info.info)
    // return false

    detailRef.value.validate((error: any) => {
      if (!error) {
        if (detail.value.id) {
          updateMeals(detail.value)
        } else {
          addMeals(detail.value)
        }
      }
    })
  }

  const updateMeals = (val: any) => {
    post({
      url: systemnoticeupdate,
      data: {
        ...val,
      },
    }).then((res) => {
      if (res.code == 0) {
        Message.success(res.msg)
        beforeClose()
        doRefresh()
      }
    })
  }

  const addMeals = (val: any) => {
    post({
      url: systemnoticeadd,
      data: {
        ...val,
      },
    }).then((res) => {
      if (res.code == 0) {
        Message.success(res.msg)
        beforeClose()
        doRefresh()
      }
    })
  }

  const beforeClose = () => {
    detail.value.id = ''
    detailRef.value.resetFields()
    visibles.value = false
  }

  function userFn() {
    useCommon.userLists().then((res) => {
      userList.value = res.data
    })
  }

  const detailFns = (val: any) => {
    title.value = '修改公告'
    detail.value = JSON.parse(JSON.stringify(val))
    visibles.value = true
  }

  function doRefresh(value?: number) {
    // eslint-disable-next-line prettier/prettier
    tableLoading.value = true
    if (value) {
      pagination.page = value
    }
    get({
      url: systemnotice,
      data: () => {
        return {
          page: pagination.page,
          size: pagination.pageSize,
          ...form,
        }
      },
    })
      .then((res) => {
        tableLoading.value = false
        table.handleSuccess(res.data.list)
        pagination.setTotalSize((res.data as any).totalSize)
      })
      .catch(console.log)
  }
  function rowClassNameFun(_record: any, index: number) {
    return index % 2 === 1 && table.striped.value ? 'table-striped' : null
  }

  const onUpdateBorder = (isBordered: boolean) => {
    tables.bordered = isBordered
  }
  function onUpdateStriped(isStriped: boolean) {
    tables.striped = isStriped
  }

  onMounted(async () => {
    await userFn()
    await doRefresh()
  })
</script>

<style lang="less" scoped>
  :deep(.arco-form-item-label) {
    width: 55px;
    text-align: left;
    height: 18px;
  }

  :deep(.arco-form-item-layout-vertical > .arco-form-item-label-col) {
    margin-bottom: 5px;
  }
  :deep(.arco-collapse-item-header-right + .arco-collapse-item-content) {
    padding-left: 0px !important;
  }
  :deep(.arco-collapse-item-content) {
    padding-right: 0px !important;
    background-color: #fff;
  }

  :deep(.arco-drawer-body) {
    padding: 0 !important;
  }
  .input516 {
    width: 480px;
    margin-left: 20px;
  }
  .box {
    display: flex;
    align-items: center;
    height: 15px;

    .line {
      width: 5px;
      height: 15px;
      margin-right: 10px;
      background-color: #40a1ff;
    }
  }

  :deep(.arco-collapse) {
    border: 0 !important;
  }

  :deep(.arco-collapse-item-header) {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-left: 20px;
    margin-top: 20px;
  }

  :deep(.arco-collapse-item-active > .arco-collapse-item-header) {
    border: 0 !important;
  }

  :deep(.arco-collapse-item-header-right) {
    padding-left: 0 !important;
    transition: none;
  }
</style>
<style>
  .arco-drawer-body {
    padding: 0 !important;
  }
</style>
